/*
 * Project: BoboDesignPattern
 * 
 * File Created at 2017年6月23日
 * 
 * Copyright 2012 Greenline.com Corporation Limited.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * Greenline Company. ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with Greenline.com.
 */
package test.thread.wait_notify.exmaple1_suitangyanyi;

/**
 * @Type ArmyRunnable
 * @Desc 军队线程
 * @author boboge
 * @date 2017年6月23日
 * @Version V1.0
 */
public class ArmyRunnable implements Runnable {

    volatile boolean keepRunning = true;

    /*
     * (non-Javadoc)
     * 
     * @see java.lang.Runnable#run()
     */
    @Override
    public void run() {

        while (keepRunning) {
            for (int i = 0; i < 5; i++) {
                System.out.println(Thread.currentThread().getName() + "攻击" + "_" + i + "i");
                // 让出cpu资源使他攻击不确定
                Thread.yield();
            }
        }

    }

}
